
# set include dir
include_directories(
  ${Boost_INCLUDE_DIRS}
  ${Glog_INCLUDE_DIRS}
  )

# set lib dir
link_directories(
  ${Boost_LIBRARIES}
  ${Glog_LIBRARIES}
  )

set(LINK_LIBS 
  boost_system
  boost_thread
  boost_chrono
  glog
  dl)

collect_source_files(SOURCE_FILES)
list(APPEND SOURCE_FILES ${COMMON_SOURCE})

if(NOT BUILD_TESTS)
  add_executable_with_pch(core SOURCE_FILES)
  target_link_libraries(core ${LINK_LIBS})
  install(TARGETS core RUNTIME DESTINATION .)
else(NOT BUILD_TESTS)
  list(REMOVE_ITEM SOURCE_FILES core_main.cpp)
  add_library_with_pch(core_unittest SOURCE_FILES)
  target_link_libraries(core_unittest ${LINK_LIBS})
  install(TARGETS core_unittest LIBRARY DESTINATION .)
endif(NOT BUILD_TESTS)

